#ifndef __WEATHER_H__
#define __WEATHER_H__
#include <config.h>
#include <pthread.h>

typedef struct currentWeather
{
	char cityName[WEATHERSIZE];
	char text[WEATHERSIZE];
	char code[WEATHERSIZE];
	char temperature[WEATHERSIZE];
}T_currentWeather,*PT_currentWeather;

typedef struct futureWeather
{
	char cityName[WEATHERSIZE];
	char date[WEATHERSIZE];
	char text_day[WEATHERSIZE];
	char code_day[WEATHERSIZE];
	char text_night[WEATHERSIZE];
	char code_night[WEATHERSIZE];
	char high[WEATHERSIZE];
	char low[WEATHERSIZE];
	char rainfall[WEATHERSIZE];
	char precip[WEATHERSIZE];
	char wind_direction[WEATHERSIZE];
	char wind_direction_degree[WEATHERSIZE];
	char wind_speed[WEATHERSIZE];
	char wind_scale[WEATHERSIZE];
	char humidity[WEATHERSIZE];
}T_futureWeather,*PT_futureWeather;

typedef struct lifeIndex
{
	char cityName[WEATHERSIZE];
	char date[WEATHERSIZE];
	char ac[WEATHERSIZE];
	char air_pollution[WEATHERSIZE];
	char airing[WEATHERSIZE];
	char allergy[WEATHERSIZE];
	char beer[WEATHERSIZE];
	char boating[WEATHERSIZE];
	char car_washing[WEATHERSIZE];
	char comfort[WEATHERSIZE];
	char dressing[WEATHERSIZE];
	char fishing[WEATHERSIZE];
	char flu[WEATHERSIZE];
	char kiteflying[WEATHERSIZE];
	char makeup[WEATHERSIZE];
	char mood[WEATHERSIZE];
	char morning_sport[WEATHERSIZE];
	char road_condition[WEATHERSIZE];
	char shopping[WEATHERSIZE];
	char sport[WEATHERSIZE];
	char sunscreen[WEATHERSIZE];
	char traffic[WEATHERSIZE];
	char umbrella[WEATHERSIZE];
	char uv[WEATHERSIZE];
}T_lifeIndex,*PT_lifeIndex;

typedef struct weatherOpr
{
	pthread_t tid;
	PT_currentWeather (*getCurrentWeatherData)(char *city);
	PT_futureWeather (*getFutureWeatherData)(char *city);
	PT_lifeIndex (*getLifeIndexData)(char *city);
}T_weatherOpr,*PT_weatherOpr;

int weatherThreadInit(void);
int weatherThreadExit(void);
int setCurrentCity(char *city);

extern char *g_pCurrentWeatherBuff;
extern char *g_pFutureWeatherBuff;
extern char *g_pLifeIndexBuff;
extern char g_weatherFlag;
extern pthread_mutex_t weatherMutex;

#endif

